Minor changes required for nnet3 sequence training#560
Minor changes required for nnet3 sequence training#560danpovey merged 1 commit intokaldi-asr:chainfrom
Conversation
|
Thanks- will try to review soon. @vijayaditya, if you have time please take a look. |
|
OK, I will work on this after the ivector PR from Yiming. --VIjay On Sat, Mar 5, 2016 at 9:45 PM, Daniel Povey notifications@github.com
|
|
Note: This is not the full set of changes. There is a lot of codes and scripts, which is beyond what the github diff allows to view. So I am committing them in small chunks that would be easier to look at. This is first set of commits. |
|
I can push the next set of commits once this is merged. |
| // negated costs. Requires that lat be topologically sorted. This code | ||
| // will work for either CompactLattice or Latice. | ||
| template<typename LatticeType> | ||
| double ComputeLatticeAlphasAndBetas(const LatticeType &lat, |
There was a problem hiding this comment.
vimal, it's not good for compilation speed to define this in the header.
Just declare it in the header, and in the .cc file, define it and instantiate it for float and double.
|
OK, done. Please merge or rebase. |
cb187d9 to
541e4ae
Compare
|
I have changed the functions to use SetUnderlyingLearningRate |
src/nnet3/nnet-utils.cc
Outdated
| if (uc == NULL) | ||
| KALDI_ERR << "Updatable component does not inherit from class " | ||
| "UpdatableComponent; change this code."; | ||
| uc->SetUnderlyingLearningRate(uc->LearningRate() * learning_rate_scale); |
There was a problem hiding this comment.
you actually want to use SetActualLearningRate() here.
|
I made the change. |
src/lat/lattice-functions.h
Outdated
| vector<double> *beta); | ||
|
|
||
|
|
||
| static inline double LogAddOrMax(bool viterbi, double a, double b) { |
There was a problem hiding this comment.
do you still need this function to be in the header?
There was a problem hiding this comment.
Its a small function that can be inlined. If it is moved to .cc file, it
cannot be inlined.
On Sun, Mar 6, 2016 at 8:19 PM Daniel Povey notifications@github.com
wrote:
In src/lat/lattice-functions.h
#560 (comment):@@ -74,6 +74,26 @@ bool ComputeCompactLatticeAlphas(const CompactLattice &lat,
bool ComputeCompactLatticeBetas(const CompactLattice &lat,
vector *beta);
+static inline double LogAddOrMax(bool viterbi, double a, double b) {
do you still need this function to be in the header?
—
Reply to this email directly or view it on GitHub
https://github.com/kaldi-asr/kaldi/pull/560/files#r55153738.Vimal Manohar
PhD Student
Electrical & Computer Engineering
Johns Hopkins University
There was a problem hiding this comment.
so you are going to call it from some other code you have written?
There was a problem hiding this comment.
also if you are going to leave it in the header you should take away the 'static'.
888ddc2 to
5bd5fb4
Compare
|
It seems there was only function that used it, which is not back in the .cc file. So I moved it to the .cc file. |
src/lat/lattice-functions.cc
Outdated
| return true; | ||
| } | ||
|
|
||
| static inline double LogAddOrMax(bool viterbi, double a, double b) { |
There was a problem hiding this comment.
ok, you've now just moved this code around. could you revert this file?
|
and please squash your commits. |
5bd5fb4 to
10fbf54
Compare
|
Done |
| bool binary, | ||
| Vector<BaseFloat> *vec); | ||
|
|
||
| void RoundUpNumFrames(int32 frame_subsampling_factor, |
There was a problem hiding this comment.
you should document this declaration.
10fbf54 to
cf7a66b
Compare
No description provided.